/*
 * @Descripttion:
 * @version:
 * @Date: 2021-04-20 11:06:21
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2021-04-21 09:36:55
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 */
import request from '@/utils/request'

// // 登录接口
export const Login = data => {
  return request({
    url: '/service-user/airui/api/user/login',
    method: 'post',
    data,
  })
}
// 登录接口
export const phone = data => {
  return request({
    url: '/service-user/airui/api/user/login',
    method: 'post',
    data,
  })
}

// 获取登录用户信息
export const GetUserinfo = () => {
  return request({
    url: '/service-user/airui/api/user/userinfo',
    method: 'get',
  })
}
//获取验证码
export const GetValidateCode = () => {
  return request({
    url: '/service-user/airui/api/user/getValidateCode',
    method: 'get',
  })
}

//获取短信验证码
export function send(mobile) {
  return request({
    url: '/service-user/airui/api/user/send?phone=' + mobile,
    method: 'get',
  })
}
//忘记
export const updatePass = data => {
  return request({
    url: '/service-user/airui/api/user/updatePass',
    method: 'post',
    data,
  })
}
//用户退出
export const Logout = () => {
  return request({
    url: '/service-user/airui/api/user/logout',
    method: 'get',
  })
}
//注册
export const registerUser = data => {
  return request({
    url: '/service-user/airui/api/user/register',
    method: 'post',
    data,
  })
}
// export const havephone = () => {
//   return request({
//     url: '/airui/api/user/haveMobile?mobile=',
//     method: 'get',
//
//   })
// }
// 获取短信验证码
export function havephone(mobile) {
  return request({
    url: '/service-user/airui/api/user/haveMobile?mobile=' + mobile,
    method: 'get',
  })
}
// export const havephone = mobile => {
//   return request({
//     url: '/airui/api/user/haveMobile',
//     method: 'get',
//     params: {
//       mobile:mobile
//     },
//   })
// }

//忘记
export const updatePs = data => {
  return request({
    url: '/service-user/airui/api/user/Pass',
    method: 'post',
    data,
  })
}
